Model run by stephane.hess using Apollo 0.3.6 on R 4.5.1 for Darwin. Please acknowledge the use of Apollo by citing Hess & Palma (2019) DOI 10.1016/j.jocm.2019.100170 www.ApolloChoiceModelling.com Model name : Hybrid_with_OL_and_MMNL_bayesian Model description : Hybrid choice model on drug choice data, bayesian estimation Model run at : 2025-09-19 14:56:57.503052 Estimation method : Hierarchical Bayes Number of individuals : 1000 Number of rows in database : 10000 Number of modelled outcomes : 14000 choice : 10000 indic_quality : 1000 indic_ingredients : 1000 indic_patent : 1000 indic_dominance : 1000 Number of cores used : 1 Estimation carried out using RSGHB Burn-in iterations : 20000 Post burn-in iterations : 10000 Classical model fit statistics were calculated at parameter values obtained using averaging across the post burn-in iterations. LL(start) : -19973.99 LL (whole model) at equal shares, LL(0) : -20300.7 LL (whole model) at observed shares, LL(C) : -19050.2 LL(final, whole model) : -17033.25 Rho-squared vs equal shares : Not applicable Adj.Rho-squared vs equal shares : Not applicable Rho-squared vs observed shares : Not applicable Adj.Rho-squared vs observed shares : Not applicable AIC : 34156.51 BIC : 34480.97 Equiv. estimated parameters : 45 (non-random parameters : 41) (means of random parameters : 2) (covariance matrix terms : 2) LL(0,choice) : -13862.94 LL(final,choice) : -11360.52 LL(0,indic_quality) : -1609.44 LL(final,indic_quality) : -1454.9 LL(0,indic_ingredients) : -1609.44 LL(final,indic_ingredients) : -1491.96 LL(0,indic_patent) : -1609.44 LL(final,indic_patent) : -1489.61 LL(0,indic_dominance) : -1609.44 LL(final,indic_dominance) : -1426.86 Time taken (hh:mm:ss) : 00:05:27.71 pre-estimation : 00:00:0.75 estimation : 00:05:23.84 post-estimation : 00:00:3.13 Summary of parameter chains Non-random coefficients These outputs have had the scaling used in estimation applied to them Mean SD gamma_Artemis_reg_user -0.0055 0.0034 gamma_Artemis_university 0.0225 0.0026 gamma_Artemis_age_50 -0.0210 0.0040 gamma_Novum_reg_user 0.0296 0.0040 gamma_Novum_university 0.0112 0.0050 gamma_Novum_age_50 0.0213 0.0025 b_brand_BestValue 0.7542 0.0450 b_brand_Supermarket 1.0677 0.0393 b_brand_PainAway 0.0000 NA b_country_CH 0.6708 0.0307 b_country_DK 0.3128 0.0251 b_country_USA 0.0000 NA b_country_IND -0.2888 0.0211 b_country_RUS -0.8150 0.0434 b_country_BRA -0.6135 0.0496 b_char_standard 0.0000 NA b_char_fast 0.7988 0.0242 b_char_double 1.2776 0.0228 b_risk -0.0016 0.0001 b_price -0.7299 0.0167 gamma_LV_reg_user -0.9654 0.0311 gamma_LV_university -0.4971 0.0205 gamma_LV_age_50 0.4203 0.0233 lambda 0.6567 0.0325 zeta_quality 0.9173 0.0309 zeta_ingredient -0.7753 0.0174 zeta_patent 1.0082 0.0307 zeta_dominance -0.6273 0.0481 tau_quality_1 -1.9161 0.0362 tau_quality_2 -0.9968 0.0371 tau_quality_3 1.0470 0.0371 tau_quality_4 2.0663 0.0369 tau_ingredients_1 -2.1288 0.0344 tau_ingredients_2 -0.9736 0.0405 tau_ingredients_3 0.7078 0.0579 tau_ingredients_4 1.5825 0.0492 tau_patent_1 -1.8335 0.0427 tau_patent_2 -0.8270 0.0578 tau_patent_3 1.0137 0.0578 tau_patent_4 1.8683 0.0330 tau_dominance_1 -2.2148 0.0391 tau_dominance_2 -1.0879 0.0382 tau_dominance_3 0.9575 0.0304 tau_dominance_4 1.9720 0.0456 Results for posterior means for random coefficients These outputs have had the scaling used in estimation applied to them Mean SD b_brand_Artemis_base 1.5079 0.0915 b_brand_Novum_base 1.2040 0.1257 eta 0.0290 0.7623 Summary of distributions of random coeffients (after distributional transforms) These outputs have had the scaling used in estimation applied to them Mean SD b_brand_Artemis_base 1.5129 0.3018 b_brand_Novum_base 1.2029 0.3516 eta -0.0057 0.9886 Covariance matrix of random coeffients (after distributional transforms) These outputs have had the scaling used in estimation applied to them b_brand_Artemis_base b_brand_Novum_base eta b_brand_Artemis_base 0.0911 -0.0012 0.0000 b_brand_Novum_base -0.0012 0.1236 0.0066 eta 0.0000 0.0066 0.9773 Correlation matrix of random coeffients (after distributional transforms) These outputs have had the scaling used in estimation applied to them b_brand_Artemis_base b_brand_Novum_base eta b_brand_Artemis_base 1.0000 -0.0112 0.0000 b_brand_Novum_base -0.0112 1.0000 0.0189 eta 0.0000 0.0189 1.0000 Upper level model results for mean parameters for underlying Normals These outputs have NOT had the scaling used in estimation applied to them Mean SD b_brand_Artemis_base 1.5078 0.0474 b_brand_Novum_base 1.2040 0.0465 eta 0.0000 0.0000 Upper level model results for covariance matrix for underlying Normals (means across iterations) These outputs have NOT had the scaling used in estimation applied to them b_brand_Artemis_base b_brand_Novum_base eta b_brand_Artemis_base 0.0899 0.0000 0 b_brand_Novum_base 0.0000 0.1237 0 eta 0.0000 0.0000 1 Upper level model results for covariance matrix for underlying Normals (SD across iterations) These outputs have NOT had the scaling used in estimation applied to them b_brand_Artemis_base b_brand_Novum_base eta b_brand_Artemis_base 0.0222 0.0000 0 b_brand_Novum_base 0.0000 0.0288 0 eta 0.0000 0.0000 0 Chain convergence report (Geweke test) Fixed (non random) parameters (t-test value for Geweke test) gamma_Artemis_reg_user gamma_Artemis_university gamma_Artemis_age_50 4.0943 0.3548 2.9552 gamma_Novum_reg_user gamma_Novum_university gamma_Novum_age_50 -1.7158 -1.9404 -4.3416 b_brand_BestValue b_brand_Supermarket b_country_CH -5.4924 -0.2223 -0.4232 b_country_DK b_country_IND b_country_RUS -1.8956 5.2087 -0.7837 b_country_BRA b_char_fast b_char_double 1.7016 -6.6331 2.8750 b_risk b_price gamma_LV_reg_user 3.3526 1.7580 7.1758 gamma_LV_university gamma_LV_age_50 lambda -1.5645 0.9941 5.6762 zeta_quality zeta_ingredient zeta_patent -1.8294 -1.2106 -0.0435 zeta_dominance tau_quality_1 tau_quality_2 -0.6057 1.5631 -3.0309 tau_quality_3 tau_quality_4 tau_ingredients_1 3.6005 -1.7410 7.9915 tau_ingredients_2 tau_ingredients_3 tau_ingredients_4 0.2193 2.0755 5.7924 tau_patent_1 tau_patent_2 tau_patent_3 4.4568 1.2662 6.9140 tau_patent_4 tau_dominance_1 tau_dominance_2 3.3379 5.2714 -1.5561 tau_dominance_3 tau_dominance_4 0.6090 -3.6940 Random parameters (t-test value for Geweke test) b_brand_Artemis_base b_brand_Novum_base eta -3.3248 -3.2078 NaN Covariances of random parameters (t-test value for Geweke test) b_brand_Artemis_base_b_brand_Artemis_base b_brand_Novum_base_b_brand_Artemis_base 0.1508 NaN b_brand_Novum_base_b_brand_Novum_base eta_b_brand_Artemis_base 0.9603 NaN eta_b_brand_Novum_base eta_eta NaN NaN Iteration details (overview) ---------------------------- Iteration Log-Likelihood RLH Parameter RMS Avg. Variance Acceptance Rate (Fixed) 1 -19054.55 0.1510573 0.3063957 0.09962621 0.00 500 -17568.80 0.1776331 0.8883197 0.55615653 0.07 1000 -17181.18 0.1851828 1.0267453 0.74144903 0.07 1500 -16904.79 0.1904494 1.0451030 0.72633634 0.07 2000 -16809.93 0.1922464 1.1093652 0.80919036 0.09 2500 -16725.57 0.1941047 1.0615394 0.77437203 0.07 3000 -16630.10 0.1957697 1.0938046 0.78424311 0.10 3500 -16520.42 0.1980903 1.1584296 0.90387637 0.04 4000 -16457.37 0.1995620 1.1782565 0.96031523 0.04 4500 -16375.60 0.2007193 1.1179913 0.83473876 0.08 5000 -16330.74 0.2022951 1.2034651 1.01822043 0.11 5500 -16246.60 0.2034279 1.1871580 0.99041397 0.07 6000 -16195.04 0.2043902 1.1742990 0.96093937 0.13 6500 -16168.09 0.2050902 1.1887516 0.93922043 0.06 7000 -16106.08 0.2065804 1.2361617 1.01060772 0.11 7500 -16052.15 0.2077249 1.2852184 1.09496197 0.13 8000 -16033.44 0.2081483 1.2450643 1.00881183 0.11 8500 -16012.77 0.2085583 1.1744810 0.87857530 0.13 9000 -15998.83 0.2093094 1.2416183 0.97433372 0.15 9500 -16001.92 0.2088239 1.1993215 0.92238780 0.17 10000 -16037.30 0.2083032 1.1939310 0.93696243 0.15 10500 -15995.74 0.2091745 1.2018378 0.93555486 0.15 11000 -15954.14 0.2102046 1.2351023 1.00583076 0.20 11500 -16006.00 0.2090057 1.2789072 0.99948547 0.12 12000 -15980.81 0.2097154 1.2532487 0.97476358 0.15 12500 -16001.94 0.2091011 1.2428986 0.95346522 0.19 13000 -15984.71 0.2096252 1.2832394 1.02030703 0.27 13500 -15951.52 0.2104135 1.2723685 1.03304672 0.20 14000 -16019.15 0.2088762 1.2597513 1.00390091 0.25 14500 -15979.80 0.2094983 1.2254849 0.91227181 0.31 15000 -15967.94 0.2097101 1.2431685 0.91729040 0.22 15500 -16029.65 0.2086882 1.2649474 0.99117324 0.29 16000 -15995.53 0.2093418 1.2937548 1.05205522 0.28 16500 -15959.13 0.2100679 1.2952161 1.04837657 0.28 17000 -15987.22 0.2096039 1.2922982 1.02205011 0.24 17500 -15972.92 0.2097527 1.2950496 1.02008792 0.22 18000 -15951.16 0.2100726 1.2995261 1.04918576 0.31 18500 -15954.48 0.2105852 1.3133174 1.07893141 0.22 19000 -15941.34 0.2102236 1.3261162 1.09218568 0.33 19500 -15998.59 0.2092501 1.3137344 1.03858269 0.28 20000 -15946.88 0.2104067 1.2716080 1.02931739 0.30 20500 -15955.13 0.2105298 1.2524556 0.98864249 0.98 21000 -15978.83 0.2100892 1.2427248 0.95692212 0.19 21500 -15970.99 0.2100874 1.3014495 1.02670443 0.65 22000 -15988.97 0.2093305 1.3409530 1.15076480 0.35 22500 -16013.78 0.2087117 1.2767519 0.99394651 0.71 23000 -15944.98 0.2104504 1.3081159 1.04911744 0.71 23500 -15963.44 0.2102686 1.3581434 1.14235058 2.74 24000 -16055.06 0.2081105 1.3263136 1.12481609 0.97 24500 -15966.73 0.2094076 1.3094667 1.09221221 0.97 25000 -15979.36 0.2094441 1.3103427 1.07846701 2.14 25500 -16009.39 0.2090058 1.2801393 1.01204724 0.24 26000 -16007.19 0.2090882 1.2529675 0.94343504 1.29 26500 -16012.28 0.2088022 1.2695982 0.97451212 1.29 27000 -16014.10 0.2088712 1.2658651 0.97587722 0.24 27500 -15985.49 0.2094099 1.2642961 0.97668572 0.90 28000 -16050.88 0.2079695 1.2493261 0.96671347 0.52 28500 -15938.14 0.2105330 1.2645480 0.97709780 0.74 29000 -15998.07 0.2093972 1.2335528 0.94855017 0.74 29500 -16010.48 0.2090453 1.2191618 0.91330667 0.74 30000 -15952.71 0.2105233 1.3006487 1.11869050 2.90 Acceptance Rate (Normal) 0.556 0.317 0.324 0.303 0.305 0.304 0.283 0.288 0.309 0.301 0.316 0.336 0.283 0.302 0.340 0.346 0.304 0.284 0.303 0.274 0.272 0.267 0.296 0.304 0.307 0.305 0.312 0.288 0.328 0.288 0.284 0.261 0.302 0.282 0.315 0.307 0.285 0.313 0.302 0.308 0.285 0.316 0.249 0.300 0.237 0.311 0.318 0.306 0.311 0.311 0.311 0.292 0.292 0.311 0.313 0.302 0.287 0.273 0.317 0.304 0.314 Settings and functions used in model definition: apollo_control -------------- Value modelDescr "Hybrid choice model on drug choice data, bayesian estimation" indivID "ID" HB "TRUE" outputDirectory "output/" debug "FALSE" modelName "Hybrid_with_OL_and_MMNL_bayesian" nCores "1" workInLogs "FALSE" seed "13" mixing "FALSE" noValidation "FALSE" noDiagnostics "FALSE" calculateLLC "TRUE" analyticHessian "FALSE" memorySaver "FALSE" panelData "TRUE" analyticGrad "FALSE" analyticGrad_manualSet "FALSE" overridePanel "FALSE" preventOverridePanel "FALSE" noModification "FALSE" apollo_HB --------- $hbDist b_brand_Artemis_base gamma_Artemis_reg_user gamma_Artemis_university "N" "NR" "NR" gamma_Artemis_age_50 b_brand_Novum_base gamma_Novum_reg_user "NR" "N" "NR" gamma_Novum_university gamma_Novum_age_50 b_brand_BestValue "NR" "NR" "NR" b_brand_Supermarket b_brand_PainAway b_country_CH "NR" "NR" "NR" b_country_DK b_country_USA b_country_IND "NR" "NR" "NR" b_country_RUS b_country_BRA b_char_standard "NR" "NR" "NR" b_char_fast b_char_double b_risk "NR" "NR" "NR" b_price gamma_LV_reg_user gamma_LV_university "NR" "NR" "NR" gamma_LV_age_50 lambda zeta_quality "NR" "NR" "NR" zeta_ingredient zeta_patent zeta_dominance "NR" "NR" "NR" tau_quality_1 tau_quality_2 tau_quality_3 "NR" "NR" "NR" tau_quality_4 tau_ingredients_1 tau_ingredients_2 "NR" "NR" "NR" tau_ingredients_3 tau_ingredients_4 tau_patent_1 "NR" "NR" "NR" tau_patent_2 tau_patent_3 tau_patent_4 "NR" "NR" "NR" tau_dominance_1 tau_dominance_2 tau_dominance_3 "NR" "NR" "NR" tau_dominance_4 eta "NR" "N" $gNCREP [1] 20000 $gNEREP [1] 10000 $gINFOSKIP [1] 500 $fixedA [1] NA NA 0 $fixedD [1] NA NA 1 $gFULLCV [1] FALSE $nodiagnostics [1] TRUE $modelname [1] "Hybrid_with_OL_and_MMNL_bayesian" $gVarNamesFixed [1] "gamma_Artemis_reg_user" "gamma_Artemis_university" "gamma_Artemis_age_50" [4] "gamma_Novum_reg_user" "gamma_Novum_university" "gamma_Novum_age_50" [7] "b_brand_BestValue" "b_brand_Supermarket" "b_country_CH" [10] "b_country_DK" "b_country_IND" "b_country_RUS" [13] "b_country_BRA" "b_char_fast" "b_char_double" [16] "b_risk" "b_price" "gamma_LV_reg_user" [19] "gamma_LV_university" "gamma_LV_age_50" "lambda" [22] "zeta_quality" "zeta_ingredient" "zeta_patent" [25] "zeta_dominance" "tau_quality_1" "tau_quality_2" [28] "tau_quality_3" "tau_quality_4" "tau_ingredients_1" [31] "tau_ingredients_2" "tau_ingredients_3" "tau_ingredients_4" [34] "tau_patent_1" "tau_patent_2" "tau_patent_3" [37] "tau_patent_4" "tau_dominance_1" "tau_dominance_2" [40] "tau_dominance_3" "tau_dominance_4" $gVarNamesNormal [1] "b_brand_Artemis_base" "b_brand_Novum_base" "eta" $gDIST b_brand_Artemis_base b_brand_Novum_base eta 1 1 1 $svN b_brand_Artemis_base b_brand_Novum_base eta 0 0 0 $FC gamma_Artemis_reg_user gamma_Artemis_university gamma_Artemis_age_50 0 0 0 gamma_Novum_reg_user gamma_Novum_university gamma_Novum_age_50 0 0 0 b_brand_BestValue b_brand_Supermarket b_country_CH 0 0 0 b_country_DK b_country_IND b_country_RUS 0 0 0 b_country_BRA b_char_fast b_char_double 0 0 0 b_risk b_price gamma_LV_reg_user 0 0 0 gamma_LV_university gamma_LV_age_50 lambda 0 0 1 zeta_quality zeta_ingredient zeta_patent 1 1 1 zeta_dominance tau_quality_1 tau_quality_2 1 -2 -1 tau_quality_3 tau_quality_4 tau_ingredients_1 1 2 -2 tau_ingredients_2 tau_ingredients_3 tau_ingredients_4 -1 1 2 tau_patent_1 tau_patent_2 tau_patent_3 -2 -1 1 tau_patent_4 tau_dominance_1 tau_dominance_2 2 -2 -1 tau_dominance_3 tau_dominance_4 1 2 Non-random parameters: ----------------------ngamma_Artemis_reg_user gamma_Artemis_university gamma_Artemis_age_50 gamma_Novum_reg_user gamma_Novum_university gamma_Novum_age_50 b_brand_BestValue b_brand_Supermarket b_country_CH b_country_DK b_country_IND b_country_RUS b_country_BRA b_char_fast b_char_double b_risk b_price gamma_LV_reg_user gamma_LV_university gamma_LV_age_50 lambda zeta_quality zeta_ingredient zeta_patent zeta_dominance tau_quality_1 tau_quality_2 tau_quality_3 tau_quality_4 tau_ingredients_1 tau_ingredients_2 tau_ingredients_3 tau_ingredients_4 tau_patent_1 tau_patent_2 tau_patent_3 tau_patent_4 tau_dominance_1 tau_dominance_2 tau_dominance_3 tau_dominance_4 Random parameters (Distribution): ---------------------------------nb_brand_Artemis_base ( ) b_brand_Novum_base ( ) eta ( ) Prior Variance-Covariance Matrix: --------------------------------- b_brand_Artemis_base b_brand_Novum_base eta b_brand_Artemis_base 2 0 0 b_brand_Novum_base 0 2 0 eta 0 0 2 apollo_probabilities ---------------------- function(apollo_beta, apollo_inputs, functionality="estimate"){ ### Attach inputs and detach after function exit apollo_attach(apollo_beta, apollo_inputs) on.exit(apollo_detach(apollo_beta, apollo_inputs)) ### create random components LV = gamma_LV_reg_user*regular_user + gamma_LV_university*university_educated + gamma_LV_age_50*over_50 + eta b_brand_Artemis = b_brand_Artemis_base + gamma_Artemis_reg_user*regular_user + gamma_Artemis_university*university_educated + gamma_Artemis_age_50*over_50 b_brand_Novum = b_brand_Novum_base + gamma_Novum_reg_user*regular_user + gamma_Novum_university*university_educated + gamma_Novum_age_50*over_50 ### Create list of probabilities P P = list() ### Likelihood of choices ### List of utilities: these must use the same names as in mnl_settings, order is irrelevant V = list() V[['alt1']] = ( b_brand_Artemis*(brand_1=="Artemis") + b_brand_Novum*(brand_1=="Novum") + b_country_CH*(country_1=="Switzerland") + b_country_DK*(country_1=="Denmark") + b_country_USA*(country_1=="USA") + b_char_standard*(char_1=="standard") + b_char_fast*(char_1=="fast acting") + b_char_double*(char_1=="double strength") + b_risk*side_effects_1 + b_price*price_1 + lambda*LV ) V[['alt2']] = ( b_brand_Artemis*(brand_2=="Artemis") + b_brand_Novum*(brand_2=="Novum") + b_country_CH*(country_2=="Switzerland") + b_country_DK*(country_2=="Denmark") + b_country_USA*(country_2=="USA") + b_char_standard*(char_2=="standard") + b_char_fast*(char_2=="fast acting") + b_char_double*(char_2=="double strength") + b_risk*side_effects_2 + b_price*price_2 + lambda*LV ) V[['alt3']] = ( b_brand_BestValue*(brand_3=="BestValue") + b_brand_Supermarket*(brand_3=="Supermarket") + b_brand_PainAway*(brand_3=="PainAway") + b_country_USA*(country_3=="USA") + b_country_IND*(country_3=="India") + b_country_RUS*(country_3=="Russia") + b_country_BRA*(country_3=="Brazil") + b_char_standard*(char_3=="standard") + b_char_fast*(char_3=="fast acting") + b_risk*side_effects_3 + b_price*price_3 ) V[['alt4']] = ( b_brand_BestValue*(brand_4=="BestValue") + b_brand_Supermarket*(brand_4=="Supermarket") + b_brand_PainAway*(brand_4=="PainAway") + b_country_USA*(country_4=="USA") + b_country_IND*(country_4=="India") + b_country_RUS*(country_4=="Russia") + b_country_BRA*(country_4=="Brazil") + b_char_standard*(char_4=="standard") + b_char_fast*(char_4=="fast acting") + b_risk*side_effects_4 + b_price*price_4 ) ### Define settings for MNL model component mnl_settings = list( alternatives = c(alt1=1, alt2=2, alt3=3, alt4=4), avail = list(alt1=1, alt2=1, alt3=1, alt4=1), choiceVar = best, utilities = V ) ### Compute probabilities for MNL model component P[["choice"]] = apollo_mnl(mnl_settings, functionality) ### Likelihood of indicators ol_settings1 = list(outcomeOrdered = attitude_quality, utility = zeta_quality*LV, tau = list(tau_quality_1, tau_quality_2, tau_quality_3, tau_quality_4), rows = (task==1)) ol_settings2 = list(outcomeOrdered = attitude_ingredients, utility = zeta_ingredient*LV, tau = list(tau_ingredients_1, tau_ingredients_2, tau_ingredients_3, tau_ingredients_4), rows = (task==1)) ol_settings3 = list(outcomeOrdered = attitude_patent, utility = zeta_patent*LV, tau = list(tau_patent_1, tau_patent_2, tau_patent_3, tau_patent_4), rows = (task==1)) ol_settings4 = list(outcomeOrdered = attitude_dominance, utility = zeta_dominance*LV, tau = list(tau_dominance_1, tau_dominance_2, tau_dominance_3, tau_dominance_4), rows = (task==1)) P[["indic_quality"]] = apollo_ol(ol_settings1, functionality) P[["indic_ingredients"]] = apollo_ol(ol_settings2, functionality) P[["indic_patent"]] = apollo_ol(ol_settings3, functionality) P[["indic_dominance"]] = apollo_ol(ol_settings4, functionality) ### Likelihood of the whole model P = apollo_combineModels(P, apollo_inputs, functionality) ### Prepare and return outputs of function P = apollo_prepareProb(P, apollo_inputs, functionality) return(P) }